# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_UnifiedCalloutAsset do
  @moduledoc """
  A unified callout asset.

  ## Attributes

  *   `adScheduleTargets` (*type:* `list(GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_AdScheduleInfo.t)`, *default:* `nil`) - List of non-overlapping schedules specifying all time intervals for which the asset may serve. There can be a maximum of 6 schedules per day, 42 in total.
  *   `calloutText` (*type:* `String.t`, *default:* `nil`) - The callout text. The length of this string should be between 1 and 25, inclusive.
  *   `endDate` (*type:* `String.t`, *default:* `nil`) - Last date of when this asset is effective and still serving, in yyyy-MM-dd format.
  *   `startDate` (*type:* `String.t`, *default:* `nil`) - Start date of when this asset is effective and can begin serving, in yyyy-MM-dd format.
  *   `useSearcherTimeZone` (*type:* `boolean()`, *default:* `nil`) - Whether to show the asset in search user's time zone. Applies to Microsoft Ads.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :adScheduleTargets =>
            list(GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_AdScheduleInfo.t())
            | nil,
          :calloutText => String.t() | nil,
          :endDate => String.t() | nil,
          :startDate => String.t() | nil,
          :useSearcherTimeZone => boolean() | nil
        }

  field(:adScheduleTargets,
    as: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_AdScheduleInfo,
    type: :list
  )

  field(:calloutText)
  field(:endDate)
  field(:startDate)
  field(:useSearcherTimeZone)
end

defimpl Poison.Decoder,
  for: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_UnifiedCalloutAsset do
  def decode(value, options) do
    GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_UnifiedCalloutAsset.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_UnifiedCalloutAsset do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
